/*------------------------------------------------------------------------
 *  Copyright (C) 2010  Luis M. de la Cruz
 *
 *  This file is part of TUNA
 *
 *  TUNA is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  TUNA is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ------------------------------------------------------------------------*/

#ifndef _TDMA_H_
#define _TDMA_H_

#include "Tuna.hpp"
#include "Storage/DiagonalMatrix.hpp"

namespace Tuna {

/*!
 ***************************************************************************
 *  \namespace Solver
 *  Contains algorithms to solve Tri-, Penta- and Hepta-diagonal matrices.
 ***************************************************************************
 *  \author Luis M. de la Cruz [ Sun Mar 23 15:03:47 GMT 2008 ]
 ***************************************************************************
 */
  namespace Solver {


    template<typename T_eq>
    int GaussSeidel1D(T_eq &, double, int);

    template<typename T_eq>
    bool TDMA1D(T_eq &);

    template<typename T_eq>
    int TDMA2DX(T_eq &, double, int, double theta = 1.85); 

    template<typename T_eq>
    int TDMA2DY(T_eq &, double, int, double theta = 1.85); 

    template<typename T_eq>
    int TDMA3D(T_eq &, double, int, double theta = 1.85); 


    template<class T_eq>
    bool lineX_2D(T_eq &, double);

    template<class T_eq>
    bool lineY_2D(T_eq &, double);

    template<class T_eq>
    bool lineX_3D(T_eq &, double);
    
    template<class T_eq>
    bool lineY_3D(T_eq &, double);
    
    template<class T_eq>
    bool lineZ_3D(T_eq &, double);
    
    template<class Vector>
    Vector thomas(const Vector &, const Vector &, 
		  const Vector &, const Vector &);

// Krylov solvers
//    template<typename T_eq, typename Vector>
//    int CG(T_eq, Vector, Vector, double, int)
//    {}

  } // Solver namespace

} // Tuna namespace

#include "../../src/Solvers/TDMA.cpp"

#endif //_TDMA_H_


































































